<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        /*隐藏底端的ghost*/
        body > div.site-wrapper > footer > div > nav > a:nth-child(4){
            display:none;
        }
        /*分享按钮的样式*/
        .social-share{
            position:fixed;
            bottom:100px;
            right:5px;
            width:32px;
            z-index:1000;
        }
        .social-share .icon-wechat .wechat-qrcode{
            top: -73px !important;
            left: -210px !important;
        }
        .social-share .icon-wechat .wechat-qrcode:after{
            content: '';
            position: absolute;
            left: 50% !important;
            margin-left: 99px !important;
            bottom: 50% !important;
            width: 0;
            height: 0;
            border-width: 6px 6px 6px 8px !important;
            border-style: solid;
            border-color: transparent transparent transparent #fff !important;
        }
    </style>
</head>
<body>
<div class="fl">分享到：</div>
<div onclick="shareTo('qzone')">
    <img src="http://www.mochoublog.com/static/images/qqzoneshare.png" width="30">
</div>
<div onclick="shareTo('qq')">
    <img src="http://www.mochoublog.com/static/images/qqshare.png" width="32">
</div>
<div onclick="shareTo('sina')">
    <img src="http://www.mochoublog.com/static/images/sinaweiboshare.png" width="36">
</div>
<div onclick="shareTo('wechat')">
    <img src="http://www.mochoublog.com/static/images/wechatshare.png" width="32">
</div>
<script >

    function shareTo(stype){
        var ftit = '';
        var flink = '';
        var lk = '';
        //获取文章标题
        ftit = $('.pctitle').text();
        //获取网页中内容的第一张图片
        flink = $('.pcdetails img').eq(0).attr('src');
        if(typeof flink == 'undefined'){
            flink='';
        }
        //当内容中没有图片时，设置分享图片为网站logo
        if(flink == ''){
            lk = 'http://'+window.location.host+'/static/images/logo.png';
        }
        //如果是上传的图片则进行绝对路径拼接
        if(flink.indexOf('/uploads/') != -1) {
            lk = 'http://'+window.location.host+flink;
        }
        //百度编辑器自带图片获取
        if(flink.indexOf('ueditor') != -1){
            lk = flink;
        }
        //qq空间接口的传参
        if(stype=='qzone'){
            window.open('https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+document.location.href+'?sharesource=qzone&title='+ftit+'&pics='+lk+'&summary='+document.querySelector('meta[name="description"]').getAttribute('content'));
        }
        //新浪微博接口的传参
        if(stype=='sina'){
            window.open('http://service.weibo.com/share/share.php?url='+document.location.href+'?sharesource=weibo&title='+ftit+'&pic='+lk+'&appkey=2706825840');
        }
        //qq好友接口的传参
        if(stype == 'qq'){
            window.open('http://connect.qq.com/widget/shareqq/index.html?url='+document.location.href+'?sharesource=qzone&title='+ftit+'&pics='+lk+'&summary='+document.querySelector('meta[name="description"]').getAttribute('content')+'&desc=php自学网，一个web开发交流的网站');
        }
        //生成二维码给微信扫描分享，php生成，也可以用jquery.qrcode.js插件实现二维码生成
        if(stype == 'wechat'){
            window.open('http://www.mochoublog.com/inc/qrcode_img.php?url=http://www.mochoublog.com/article-1.html');
        }
    }

</script>
</body>
</html>